package com.dailyblue.java.spring.boot.shopping.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dailyblue.java.spring.boot.shopping.bean.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GoodsMapper extends BaseMapper<Goods> {
    @Select("select goods.*,stock.stocknum as 'num' from goods left join stock on goods.id=stock.gid")
    List<Goods> findAllGoods();
}
